package com.whut.transportation.utils;

import android.app.Application;
import android.content.Context;
import android.content.res.Configuration;
import android.telephony.TelephonyManager;
import android.util.DisplayMetrics;
import android.util.Log;
import android.widget.Toast;

/**
 * ============================================================
 * 
 * 描述 ：
 * 
 * 全局接口公共部分 
 * 
 * 修订历史 ：
 * 
 * ============================================================
 **/
public class BaseApplication extends Application {
	public String sessionid;
	public String deviceid;
	public int screenWidth;
	public int screenHeight;
	static BaseApplication mApp;

	@Override
	public void onConfigurationChanged(Configuration newConfig) {
		super.onConfigurationChanged(newConfig);
	}

	
	@Override
	public void onCreate() {
		Log.v("App", "onCreate");
		mApp = this;
		TelephonyManager tm = (TelephonyManager) this
				.getSystemService(Context.TELEPHONY_SERVICE);
		deviceid = tm.getDeviceId();
		DisplayMetrics dm = getApplicationContext().getResources()
				.getDisplayMetrics();
		screenWidth = dm.widthPixels;
		screenHeight = dm.heightPixels;
		super.onCreate();
	}

	@Override
	public void onLowMemory() {
		super.onLowMemory();
	}
	
	@Override
	// 建议在您app的退出之前调用mapadpi的destroy()函数，避免重复初始化带来的时间消耗
	public void onTerminate() {
		super.onTerminate();
	}

}
